package com.poc.importacao.baseabstract;

import java.io.IOException;
import java.sql.SQLException;

import com.poc.database.DatabaseManager;

public abstract class AbstractManager extends Setup {

    public static DatabaseManager databaseManager;

    protected static DatabaseManager getDatabaseManager() throws SQLException {
	if (AbstractManager.databaseManager == null) {
	    AbstractManager.databaseManager = DatabaseManager.getInstance();
	}
	return AbstractManager.databaseManager;
    }

    public abstract void createInserts(String fileName) throws SQLException, IOException;

    protected void finalize() {
	try {
	    AbstractManager.databaseManager.finalize();
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }
}